package com.study.thread.unsafeAndCas;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerDemo {
    private static AtomicInteger atomicInteger = new AtomicInteger();

    public static void main(String[] args) {
        for (int i = 0; i < 20; i++) {
            new Thread(() -> {
                System.out.println(atomicInteger.getAndIncrement());
            }).start();
        }


        System.out.println("fff：" + atomicInteger.get());

    }
}
